<form action="/management/admin_estimate.php" method="post" name="listform">
<input type="hidden" name="method" value="">
<input type="hidden" name="p" value="{{$curPage}}">
<table width="100%" class="search">
<tr>
	<td class="title">评论ID：</td>
	<td><input type="text" name="est_id" style="width:70px;" value="{{$smarty.request.est_id}}"></td>
	<td class="title">企业ID：</td>
	<td><input type="text" name="cor_id" style="width:70px;" value="{{$smarty.request.cor_id}}"></td>
	<td class="title">评论者登录ID：</td>
	<td><input type="text" name="user_id" style="width:70px;" value="{{$smarty.request.user_id}}"></td>
	<td class="title">评论者名字：</td>
	<td><input type="text" name="user_name" style="width:70px;" value="{{$smarty.request.user_name}}"></td>
</tr>
<tr>
	<td class="title">评论时间：</td>
	<td colspan="3"><input type="text" name="time_1" style="width:80px;" onClick="WdatePicker()" value="{{$smarty.request.time_1}}">-<input type="text" name="time_2" style="width:80px;" onClick="WdatePicker()" value="{{$smarty.request.time_2}}"></td>
	<td class="title">审核状态：</td>
	<td>{{html_checkboxes options=$show_flg_arr checked=$smarty.request.show_flg name="show_flg"}}</td>
	<td colspan="2" align="center"><input type="submit" class="button" value="搜索"></td>
</tr>
</table>
<div style="border: 1px dotted #CCCCCC; margin:10px 0;"></div>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="list">
	<tr>
		<th width="10%" >全选<input type="checkbox" onclick="checkAll(this)" id="checkall"></th>
		<th width="40%">评价内容</th>
		<th width="15%">企业名称</th>
		<th width="10%">评价者</th>
		<th width="10%">评价时间</th>
		<th width="10%">回应数</th>
		<th width="5%"></th>
	</tr>
	{{foreach from=$row key=key item=item name="est"}}
	<tr {{if $smarty.foreach.est.index%2 eq '0'}}class="even"{{/if}}>
		<td align="center"><input type="checkbox" class="selectId" name="selectId[]" value="{{$item.id}}" onclick="checkOne()">{{$item.id}}</td>
		<td align="center"><div style="width:350px;">{{$item.content}}</div></td>
		<td align="center"><a target="_blank" href="{{$host_root}}/corporation/{{$item.cor_id}}.html">{{$item.cor_name}}</a></td>
		<td align="center">{{$item.user_name}}</td>
		<td align="center">{{$item.create_time|date_format:"%Y-%m-%d %H:%M:%S"}}</td>
		<td align="center">{{$item.count}}</td>
		<td align="center"><input type="button" class="delbtn" onclick="my_del('{{$smarty.server.PHP_SELF}}',{{$item.id}}, this)" value="删除"></td>
	</tr>
	{{/foreach}}
</table>
</form>
<div class="operation">
	<ul>
		<li><input type="button" value="批量删除" onclick="delAll();" style="cursor:pointer;"></li>
		<li><input type="button" value="永久删除" onclick="delCompletely();" style="background-color:red;cursor:pointer;"></li>
		<li><input type="button" value="审核通过" onclick="auditing();" style="cursor:pointer;"></li>
	</ul>
	<div style="clear:both;"></div>
</div>
<div class="fenye">{{$pageList}}</div>
<script type="text/javascript">
	function delAll()
	{
		var checkbox_objs = $(".selectId");
		var n = 0;
		for(var i=0; i < checkbox_objs.length; i++){
			if(checkbox_objs[i].checked){
				n++;
			}
		}
		if(n < 1){
			alert("至少选择一项");
			return false;
		}
		if(!confirm("确认删除吗？"))return false;
		document.listform.method.value = 'delAll';
		document.listform.submit();
	}
	function delCompletely()
	{
		var checkbox_objs = $(".selectId");
		var n = 0;
		for(var i=0; i < checkbox_objs.length; i++){
			if(checkbox_objs[i].checked){
				n++;
			}
		}
		if(n < 1){
			alert("至少选择一项");
			return false;
		}
		if(!confirm("确认永久删除吗？删除后数据将无法恢复！"))return false;
		document.listform.method.value = 'delCompletely';
		document.listform.submit();
	}
	function auditing()
	{
		var checkbox_objs = $(".selectId");
		var n = 0;
		for(var i=0; i < checkbox_objs.length; i++){
			if(checkbox_objs[i].checked){
				n++;
			}
		}
		if(n < 1){
			alert("至少选择一项");
			return false;
		}
		
		document.listform.method.value = 'auditing';
		document.listform.submit();
	}
</script>